export function searchColumns() {
  return [
    {
      filterable: true,
      type: 'select',
      prop: 'no',
      dicData: this.dataList.map(item => {
        return { value: item?.id, label: item?.no }
      }),
      placeholder: '请选择渠道号',
    },
    {
      filterable: true,
      type: 'select',
      prop: 'name',
      dicData: this.dataList.map(item => {
        return { value: item?.id, label: item?.name }
      }),
      placeholder: '请选择渠道名称',
    },
    {
      filterable: true,
      type: 'select',
      prop: 'alias',
      dicData: this.dataList.map(item => {
        return { value: item?.id, label: item?.alias }
      }),
      placeholder: '请选择渠道别名',
    },
    {
      filterable: true,
      type: 'select',
      prop: 'merchant',
      dicData: this.dataList.map(item => {
        return { value: item?.id, label: item?.merchant }
      }),
      placeholder: '请选择渠道商',
    },
  ]
}

export function tableColumns() {
  return [
    {
      width: 140,
      label: '渠道创建日期',
      prop: 'create_at',
      formatter: row => this.$formatTime(row.create_at),
    },
    {
      width: 140,
      label: '渠道号',
      prop: 'no',
    },
    {
      label: '渠道商',
      prop: 'merchant',
    },
    {
      label: '渠道名称',
      prop: 'name',
    },
    {
      label: '渠道别名',
      prop: 'alias',
    },
  ]
}

export function addDialogForm() {
  return [
    {
      disabled: this.show,
      label: '渠道号',
      prop: 'no',
    },
    {
      label: '渠道商',
      prop: 'merchant',
    },
    {
      label: '渠道名称',
      prop: 'name',
    },
    {
      label: '渠道别名',
      prop: 'alias',
    },
  ]
}
